﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Net.Mail;
using System.Web;
using System.Net;
namespace BAL
{
    public class Customers
    {
        public static string con = BAL.conn.connectionString;
        public static int verifyuser(string username, string password, int login)
        {
            SqlParameter[] arrParam = new SqlParameter[3];
            arrParam[0] = new SqlParameter("@username", SqlDbType.VarChar);
            arrParam[0].Value = username;
            arrParam[1] = new SqlParameter("@password", SqlDbType.VarChar);
            arrParam[1].Value = password;
            arrParam[2] = new SqlParameter("@login", SqlDbType.Int);
            arrParam[2].Value = login;
            int Val = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_verifyuser", arrParam));
            return Val;
        }

        public static int GetUserType(int UserId, int login)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            arrParam[1] = new SqlParameter("@login", SqlDbType.Int);
            arrParam[1].Value = login;
            int val = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_GetUserTypeID", arrParam));
            return val;

        }

        public static int GetTechType(int UserId, int login)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            arrParam[1] = new SqlParameter("@login", SqlDbType.Int);
            arrParam[1].Value = login;
            int val = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_GetTechTypeID", arrParam));
            return val;

        }

        public static string GetLocationID(int UserId, int login)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            arrParam[1] = new SqlParameter("@login", SqlDbType.Int);
            arrParam[1].Value = login;
            string val = Convert.ToString(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_GetLocationID", arrParam));
            return val;


        }


        public static int OnForgotPassword(string username, int type)
        {
            int intReturnValue = 0;
            int val = verifyuser(username, "", type);


            if (!(val.Equals(-1)))
            {
                string pass = "";
                string Info = "";
                string strName = "User";
                string emailID = "";

                SqlParameter[] arrParam = new SqlParameter[2];
                arrParam[0] = new SqlParameter("@username", SqlDbType.VarChar);
                arrParam[0].Value = username;
                arrParam[1] = new SqlParameter("@type", SqlDbType.Int);
                arrParam[1].Value = type;


                DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ForgotPassword", arrParam);
                pass = ds.Tables[0].Rows[0]["Password"].ToString();
                strName = ds.Tables[0].Rows[0]["Name"].ToString();
                emailID = ds.Tables[0].Rows[0]["emailid"].ToString();

                if (pass != "")
                {
                    pass = BAL.Encryption.Decrypt(pass, "&%#@?,:*");
                    Info = "<span style=\"font-size:12px;\"><br>" +
                    "Dear <b>" + strName + "</b>,<br><br>Please find the details of your CTEA_INDIA account :" +
                    "<br><br>Login Username: <b>" + username + "</b><br>Password: <b>" + pass + "</b><br><br>Best Regards," +
                    "<br>CTEA_INDIA Team<br><a href=\"http://www.CTEAINDIA.in\">www.CTEAINDIA.in</a></span><br><br><img src=\"cid:companylogo\">";
                    BAL.Common.SendEmail("", emailID, "Password Recovery", Info);
                    intReturnValue = 1;
                }
            }
            return intReturnValue;
        }
        public static int TechRegistration(string EmailID, string EncryptedPass, string Address, string Location, DateTime dob, int LoginAs, string Name, string mobileno, string TechID)
        {
            SqlParameter[] arrParam = new SqlParameter[9];
            arrParam[0] = new SqlParameter("@EmailID", SqlDbType.VarChar);
            arrParam[0].Value = EmailID;
            arrParam[1] = new SqlParameter("@EncryptedPass", SqlDbType.VarChar);
            arrParam[1].Value = EncryptedPass;
            arrParam[2] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[2].Value = Address;
            arrParam[3] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[3].Value = Location;
            arrParam[4] = new SqlParameter("@dob", SqlDbType.DateTime);
            arrParam[4].Value = dob;
            arrParam[5] = new SqlParameter("@LoginAs", SqlDbType.Int);
            arrParam[5].Value = LoginAs;
            arrParam[6] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[6].Value = Name;
            arrParam[7] = new SqlParameter("@mobileno", SqlDbType.VarChar);
            arrParam[7].Value = mobileno;
            arrParam[8] = new SqlParameter("@TechID", SqlDbType.VarChar);
            arrParam[8].Value = TechID;
            int UserID = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_InsertTechRegisration", arrParam));
            return UserID;


        }



        public static int UserRegistration(string EmailID, string EncryptedPass, string Name, string Address, string Location, string Website, string Conatactno, string ContactP_Name, string ContactP_Emailid, string ContactP_Mobileno)
        {
            SqlParameter[] arrParam = new SqlParameter[10];
            arrParam[0] = new SqlParameter("@EmailID", SqlDbType.VarChar);
            arrParam[0].Value = EmailID;
            arrParam[1] = new SqlParameter("@EncryptedPass", SqlDbType.VarChar);
            arrParam[1].Value = EncryptedPass;
            arrParam[2] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[2].Value = Name;
            arrParam[3] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[3].Value = Address;
            arrParam[4] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[4].Value = Location;
            arrParam[5] = new SqlParameter("@Website", SqlDbType.VarChar);
            arrParam[5].Value = Website;
            arrParam[6] = new SqlParameter("@Conatactno", SqlDbType.VarChar);
            arrParam[6].Value = Conatactno;
            arrParam[7] = new SqlParameter("@ContactP_Name", SqlDbType.VarChar);
            arrParam[7].Value = ContactP_Name;
            arrParam[8] = new SqlParameter("@ContactP_Emailid", SqlDbType.VarChar);
            arrParam[8].Value = ContactP_Emailid;
            arrParam[9] = new SqlParameter("@ContactP_Mobileno", SqlDbType.VarChar);
            arrParam[9].Value = ContactP_Mobileno;

            int UserId = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_InsertUserRegistration", arrParam));
            return UserId;
        }

        public static int CandidateRegistration(string EmailID, string EncryptedPass, string Name, string Gender, DateTime DateOfBirth, string Address, string Location, string Mobileno, string Education, string Qualification, string ApplyFor, string Guardian_name, string Guardian_Cno, string Guardian_Location, string Relationshp, string fileName, string howKnow, string Occup, string ArtistId)
        {
            SqlParameter[] arrParam = new SqlParameter[19];
            arrParam[0] = new SqlParameter("@EmailID", SqlDbType.VarChar);
            arrParam[0].Value = EmailID;
            arrParam[1] = new SqlParameter("@EncryptedPass", SqlDbType.VarChar);
            arrParam[1].Value = EncryptedPass;
            arrParam[2] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[2].Value = Name;
            arrParam[3] = new SqlParameter("@Gender", SqlDbType.VarChar);
            arrParam[3].Value = Gender;
            arrParam[4] = new SqlParameter("@DateOfBirth", SqlDbType.DateTime);
            arrParam[4].Value = DateOfBirth;
            arrParam[5] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[5].Value = Address;
            arrParam[6] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[6].Value = Location;
            arrParam[7] = new SqlParameter("@Mobileno", SqlDbType.VarChar);
            arrParam[7].Value = Mobileno;
            arrParam[8] = new SqlParameter("@Education", SqlDbType.VarChar);
            arrParam[8].Value = Education;
            arrParam[9] = new SqlParameter("@Qualification", SqlDbType.VarChar);
            arrParam[9].Value = Qualification;
            arrParam[10] = new SqlParameter("@ApplyFor", SqlDbType.VarChar);
            arrParam[10].Value = ApplyFor;
            arrParam[11] = new SqlParameter("@Guardian_name", SqlDbType.VarChar);
            arrParam[11].Value = Guardian_name;
            arrParam[12] = new SqlParameter("@Guardian_Cno", SqlDbType.VarChar);
            arrParam[12].Value = Guardian_Cno;
            arrParam[13] = new SqlParameter("@Guardian_Location", SqlDbType.VarChar);
            arrParam[13].Value = Guardian_Location;
            arrParam[14] = new SqlParameter("@Relationshp", SqlDbType.VarChar);
            arrParam[14].Value = Relationshp;
            arrParam[15] = new SqlParameter("@fileName", SqlDbType.VarChar);
            arrParam[15].Value = fileName;
            arrParam[16] = new SqlParameter("@howKnow", SqlDbType.VarChar);
            arrParam[16].Value = howKnow;
            arrParam[17] = new SqlParameter("@Occupation", SqlDbType.VarChar);
            arrParam[17].Value = Occup;
            arrParam[18] = new SqlParameter("@ArtistId", SqlDbType.VarChar);
            arrParam[18].Value = ArtistId;
            int UserId = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_InsertCandidateRg", arrParam));
            return UserId;
        }

        public static DataSet GetAllCandidate()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetPendingCandidate");
            return ds;
        }

        public static void ApproveCandidate(int key)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@CandidateID", SqlDbType.Int);
            arrParam[0].Value = key;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_ApproveCandidate_Req", arrParam);

        }

        public static void InsertEnquiry(string Name, string Address, string Contactno, string InterestedField, string loc)
        {
            SqlParameter[] arrParam = new SqlParameter[5];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;
            arrParam[2] = new SqlParameter("@Contactno", SqlDbType.VarChar);
            arrParam[2].Value = Contactno;
            arrParam[3] = new SqlParameter("@InterestedField", SqlDbType.VarChar);
            arrParam[3].Value = InterestedField;
            arrParam[4] = new SqlParameter("@loc", SqlDbType.VarChar);
            arrParam[4].Value = loc;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertEnquiry", arrParam);


        }



        public static void InsertFeedback(int feedbackTypeID, string Name, string EmailID, string mobileno, string message)
        {
            SqlParameter[] arrParam = new SqlParameter[5];
            arrParam[0] = new SqlParameter("@feedbackTypeID", SqlDbType.Int);
            arrParam[0].Value = feedbackTypeID;
            arrParam[1] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[1].Value = Name;
            arrParam[2] = new SqlParameter("@EmailID", SqlDbType.VarChar);
            arrParam[2].Value = EmailID;
            arrParam[3] = new SqlParameter("@mobileno", SqlDbType.VarChar);
            arrParam[3].Value = mobileno;
            arrParam[4] = new SqlParameter("@message", SqlDbType.VarChar);
            arrParam[4].Value = message;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertFeedback", arrParam);

        }

        public static string[] GetCandidateProfile(int userid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@CandidateID", SqlDbType.Int);
            arrParam[0].Value = userid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetCandidateProfile", arrParam);
            int count = sdr.FieldCount;
            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();
                }
            }
            sdr.Close();
            return details;
        }

        public static void UpdateCandidateProfile(string Name, string Gender, DateTime DateOfBirth, string Address, string Location, string Mobileno, string Education, string Qualification, string ApplyFor, string Guardian_name, string Guardian_Cno, string Guardian_Location, string Relationshp, string profphoto, string EmailID, string Occu)
        {
            SqlParameter[] arrParam = new SqlParameter[16];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Gender", SqlDbType.VarChar);
            arrParam[1].Value = Gender;
            arrParam[2] = new SqlParameter("@DateOfBirth", SqlDbType.VarChar);
            arrParam[2].Value = DateOfBirth;
            arrParam[3] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[3].Value = Address;
            arrParam[4] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[4].Value = Location;
            arrParam[5] = new SqlParameter("@Mobileno", SqlDbType.VarChar);
            arrParam[5].Value = Mobileno;
            arrParam[6] = new SqlParameter("@Education", SqlDbType.VarChar);
            arrParam[6].Value = Education;
            arrParam[7] = new SqlParameter("@Qualification", SqlDbType.VarChar);
            arrParam[7].Value = Qualification;
            arrParam[8] = new SqlParameter("@ApplyFor", SqlDbType.VarChar);
            arrParam[8].Value = ApplyFor;
            arrParam[9] = new SqlParameter("@Guardian_name", SqlDbType.VarChar);
            arrParam[9].Value = Guardian_name;
            arrParam[10] = new SqlParameter("@Guardian_Cno", SqlDbType.VarChar);
            arrParam[10].Value = Guardian_Cno;
            arrParam[11] = new SqlParameter("@Guardian_Location", SqlDbType.VarChar);
            arrParam[11].Value = Guardian_Location;
            arrParam[12] = new SqlParameter("@Relationshp", SqlDbType.VarChar);
            arrParam[12].Value = Relationshp;
            arrParam[13] = new SqlParameter("@fileName", SqlDbType.VarChar);
            arrParam[13].Value = profphoto;
            arrParam[14] = new SqlParameter("@EmailID", SqlDbType.VarChar);
            arrParam[14].Value = EmailID;
            arrParam[15] = new SqlParameter("@Occupation", SqlDbType.VarChar);
            arrParam[15].Value = Occu;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateCandidateProf", arrParam);

        }

        public static string ChangePassword(int userid, int login, string EncriptedPasswd, string EncriptedNewPasswd)
        {
            SqlParameter[] arrParam = new SqlParameter[4];
            arrParam[0] = new SqlParameter("@userid", SqlDbType.Int);
            arrParam[0].Value = userid;
            arrParam[1] = new SqlParameter("@login", SqlDbType.Int);
            arrParam[1].Value = login;
            arrParam[2] = new SqlParameter("@EncriptedPasswd", SqlDbType.VarChar);
            arrParam[2].Value = EncriptedPasswd;
            arrParam[3] = new SqlParameter("@EncriptedNewPasswd", SqlDbType.VarChar);
            arrParam[3].Value = EncriptedNewPasswd;
            string UserId = Convert.ToString(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_ChangePassword", arrParam));
            return UserId;



        }
        public static string[] GetUserMasterProfile(int UserId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetUserMasterProfileById", arrParam);

            int count = sdr.FieldCount;
            string[] details = new string[count];

            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }
            }
            sdr.Close();
            return details;
        }

        public static void UpdateUserMaster(string Name, string Address, string Loc, string Phno, string Website, string CPname, string CPMob, string CPEmail, int UserId)
        {
            SqlParameter[] arrParam = new SqlParameter[9];

            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;

            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;

            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Loc;

            arrParam[3] = new SqlParameter("@LandlineNo", SqlDbType.VarChar);
            arrParam[3].Value = Phno;

            arrParam[4] = new SqlParameter("@C_website", SqlDbType.VarChar);
            arrParam[4].Value = Website;

            arrParam[5] = new SqlParameter("@ContactPerson_name", SqlDbType.VarChar);
            arrParam[5].Value = CPname;

            arrParam[6] = new SqlParameter("@ContactPerson_mobileno", SqlDbType.VarChar);
            arrParam[6].Value = CPMob;

            arrParam[7] = new SqlParameter("@ContactPerson_EmailID", SqlDbType.VarChar);
            arrParam[7].Value = CPEmail;

            arrParam[8] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[8].Value = UserId;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateUserMaster", arrParam);

        }

        public static string[] GetProfadmintech(int userid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@userid", SqlDbType.VarChar);
            arrParam[0].Value = userid;


            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetProfAdmintech", arrParam);

            int count = sdr.FieldCount;
            string[] details = new string[count];

            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }
            }
            sdr.Close();
            return details;


        }

        public static void UpdateProfAdminTech(string Name, string Address, string Location, DateTime DateOfBirth, string Mobileno, int userid  )
        {
            SqlParameter[] arrParam = new SqlParameter[6];

            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;

            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;

            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Location;

            arrParam[3] = new SqlParameter("@DateOfBirth", SqlDbType.DateTime);
            arrParam[3].Value = DateOfBirth;

            arrParam[4] = new SqlParameter("@Mobileno", SqlDbType.VarChar);
            arrParam[4].Value = Mobileno;

            arrParam[5] = new SqlParameter("@userid", SqlDbType.Int);
            arrParam[5].Value = userid;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateProfAdminTEch", arrParam);

        }

        public static void UpdateProfAdminTech2(string Name, string Address, string Location, DateTime DateOfBirth, string Mobileno, int userid
        , string fatName, string marStat, string lang, string corAdd)
        {
            SqlParameter[] arrParam = new SqlParameter[10];

            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;

            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;

            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Location;

            arrParam[3] = new SqlParameter("@DateOfBirth", SqlDbType.DateTime);
            arrParam[3].Value = DateOfBirth;

            arrParam[4] = new SqlParameter("@Mobileno", SqlDbType.VarChar);
            arrParam[4].Value = Mobileno;

            arrParam[5] = new SqlParameter("@userid", SqlDbType.VarChar);
            arrParam[5].Value = userid;

            arrParam[6] = new SqlParameter("@FatherName", SqlDbType.VarChar);
            arrParam[6].Value = fatName;
            arrParam[7] = new SqlParameter("@MaritialStat", SqlDbType.VarChar);
            arrParam[7].Value = marStat;
            arrParam[8] = new SqlParameter("@Languages", SqlDbType.VarChar);
            arrParam[8].Value = lang;
            arrParam[9] = new SqlParameter("@CorrAdd", SqlDbType.VarChar);
            arrParam[9].Value = corAdd;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateProfAdminTEchTwo", arrParam);

        }
        ////////////////////////21/04/2012//////////////////

        public static DataSet ViewAllCandidate(string locationID)
        {

            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@locationID", SqlDbType.VarChar);
            arrParam[0].Value = locationID;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewAllCandidate", arrParam);
            return ds;
        }

        public static void UpdateCandidate(string Name, string Address, string Loc, string MobNo, DateTime dob, string gender, string Edu, string Quali, string ApplyFor, string GName, string GMob, string GLoc, string Rela, string FileName, string Email, string Occu)
        {
            SqlParameter[] arrParam = new SqlParameter[16];

            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;

            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;

            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Loc;

            arrParam[3] = new SqlParameter("@Mobileno", SqlDbType.VarChar);
            arrParam[3].Value = MobNo;

            arrParam[4] = new SqlParameter("@DateOfBirth", SqlDbType.DateTime);
            arrParam[4].Value = dob;

            arrParam[5] = new SqlParameter("@Gender", SqlDbType.VarChar);
            arrParam[5].Value = gender;

            arrParam[6] = new SqlParameter("@Education", SqlDbType.VarChar);
            arrParam[6].Value = Edu;

            arrParam[7] = new SqlParameter("@Qualification", SqlDbType.VarChar);
            arrParam[7].Value = Quali;

            arrParam[8] = new SqlParameter("@ApplyFor", SqlDbType.VarChar);
            arrParam[8].Value = ApplyFor;

            arrParam[9] = new SqlParameter("@Guardian_name", SqlDbType.VarChar);
            arrParam[9].Value = GName;

            arrParam[10] = new SqlParameter("@Guardian_Cno", SqlDbType.VarChar);
            arrParam[10].Value = GMob;

            arrParam[11] = new SqlParameter("@Guardian_Location", SqlDbType.VarChar);
            arrParam[11].Value = GLoc;

            arrParam[12] = new SqlParameter("@Relationshp", SqlDbType.VarChar);
            arrParam[12].Value = Rela;

            arrParam[13] = new SqlParameter("@FileName", SqlDbType.VarChar);
            arrParam[13].Value = FileName;

            arrParam[14] = new SqlParameter("@EmailId", SqlDbType.VarChar);
            arrParam[14].Value = Email;

            arrParam[15] = new SqlParameter("@Occupation", SqlDbType.VarChar);
            arrParam[15].Value = Occu;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateCandidateProf", arrParam);
        }

        public static string[] GetCandidateById(int Cid)
        {

            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@candidateId", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetCandidateById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }


        public static void IsDeleteCandidate(int candidateId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@candidateId", SqlDbType.Int);
            arrParam[0].Value = candidateId;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_IsDeleteCandidate", arrParam);

        }

        public static DataSet ViewAllTechnical()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewAllTechnical");
            return ds;
        }




        public static DataSet getCandidateList(string ddlApplyFor)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ddlApplyFor", SqlDbType.VarChar);
            arrParam[0].Value = ddlApplyFor;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_SearchAppFor", arrParam);

            return ds;

        }

        public static DataSet GetCandidateByNameSearch(string Search)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@Search", SqlDbType.VarChar);
            arrParam[0].Value = Search;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_SearchCandidateByName", arrParam);

            return ds;

        }

        public static void SendUserDetails(string To_Email_ID, string password)
        {
            string host = HttpContext.Current.Request.Url.Host;
            string content = "<div style=\"margin-left:20px;\">" +
                             "<span style=\"font-size: 12px; font-family: 'CENTURY GOTHIC'\">" +
                             "<br>Dear <b>" + To_Email_ID + "</b>,<br><br>" +
                             "Welcome to <b>CTEA INDIA </b><br><br>" +
                             "We are pleased to welcome you to CTEA INDIA. Your account details are as mentioned below." +
                              "<br>UserID: " + To_Email_ID + "<br>Password: " + password +
                             "<br> Please change your password after login and keep this safely." +
                             "<br><br>Best Regards,<br>CTEA INDIA Team" +
                             "<br><a href=\"http://www.CTEAINDIA.in\">www.CTEAINDIA.in</a></span><br><br><img src=\"cid:companylogo\"></div>";
            string Subject = "User Details";
            BAL.Common.SendEmail("", To_Email_ID, Subject, content, 0);

        }
        public static void RegisterLink(string To_Email_ID, string UserId, string V_str, string Name)
        {
            if (Name.Trim() == "") { Name = "User"; }
            if (Name != "") { Name = "<b>" + Name + "</b>"; }
            string host = HttpContext.Current.Request.Url.Host;
            string content = "<div style=\"margin-left:20px;\">" +
                             "<span style=\"font-size: 12px; font-family: 'CENTURY GOTHIC'\">" +
                             "<br>Dear " + Name + ",<br><br>" +
                             "Warm Welcome from <b>CTEA INDIA Team!!!</b><br> We thank you for showing continued interest in CTEA INDIA.<br>" +
                             "You are just one step away from becoming a registered member." +
                             "<br>Kindly click on the link below for email id verification :" +
                             "<br><br>url: <a href=\"http://" + host + "/Confirmation.aspx?id=" +
                             UserId + "&code=" + V_str + "\">Confirm Now</a>" +
                             "<br><br>Best Regards,<br>CTEA INDIA Team<br>" +
                             "<a href=\"http://www.cteaindia.in\">www.cteaindia.in</a></span><br><br><img src=\"cid:companylogo\" height=150 width=150></div>";


            string Subject = "Confirmation mail From CTEA INDIA";
            //LinkedResource imagelink = new LinkedResource(HttpContext.Current.Server.MapPath("images/logo.jpg"));
            //imagelink.ContentId = "imageId";
            //imagelink.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;

            BAL.Common.SendEmail("", To_Email_ID, Subject, content, 0);
        }

        public static void UpdateEnquiry(DateTime SchduleDate, int EnquiryID, int IsSovled)
        {
            SqlParameter[] arrParam = new SqlParameter[3];
            arrParam[0] = new SqlParameter("SchduleDate", SqlDbType.Date);
            arrParam[0].Value = SchduleDate;
            arrParam[1] = new SqlParameter("EnquiryID", SqlDbType.Int);
            arrParam[1].Value = EnquiryID;
            arrParam[2] = new SqlParameter("IsSovled", SqlDbType.Int);
            arrParam[2].Value = IsSovled;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateEnquiryStatus", arrParam);





        }
        public static void UpdateLastLogin(int UserId, int login)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            arrParam[1] = new SqlParameter("login", SqlDbType.Int);
            arrParam[1].Value = login;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateLastLogin", arrParam);

        }

        public static DateTime GetLastLogin(int UserId, int UserTypeID)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            arrParam[1] = new SqlParameter("UserTypeId", SqlDbType.Int);
            arrParam[1].Value = UserTypeID;

            DateTime LastUSed = Convert.ToDateTime(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_GetLastLogin", arrParam));
            return LastUSed;
        }
        public static void IsDeleteTechnical(int ID)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ID", SqlDbType.Int);
            arrParam[0].Value = ID;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_IsDeleteTechnical", arrParam);

        }
        public static string[] GetTechnicalById(int ID)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ID", SqlDbType.Int);
            arrParam[0].Value = ID;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetTechnicalById", arrParam);
            int count = sdr.FieldCount;
            string[] details = new string[count];

            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();
                }
            }

            sdr.Close();
            return details;
        }

        public static DataSet GetAllTechType()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetAllTechType");
            return ds;
        }
        public static void PopulateCategory(ref DropDownList ddlCategory)
        {
            //objWsrComm = new WSRCommon.WSCommon();
            //DataSet ds = objWsrComm.GetCityList();
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, "CT_GetCandidateCategory");
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlCategory.DataSource = ds.Tables[0];

                    ddlCategory.DataTextField = "category";
                    ddlCategory.DataValueField = "category";
                    ddlCategory.DataBind();

                    //ListItem lst = new ListItem("----Select category----", "-1");
                    //ddlCategory.Items.Insert(0, lst);

                    foreach (ListItem _listItem in ddlCategory.Items)
                    {

                        _listItem.Attributes.Add("title", _listItem.Text + _listItem.Value);

                    }

                }
                else
                {
                    ddlCategory.Items.Clear();
                    //ListItem lst = new ListItem("----Select category----", "-1");
                    //ddlCategory.Items.Insert(0, lst);
                }
            }
        }

        public static void PopulateLocation(ref DropDownList ddlLocation)
        {
            //objWsrComm = new WSRCommon.WSCommon();
            //DataSet ds = objWsrComm.GetCityList();
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, "CT_GetLocationMaster");
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlLocation.DataSource = ds.Tables[0];

                    ddlLocation.DataTextField = "Location";
                    ddlLocation.DataValueField = "Location";
                    ddlLocation.DataBind();

                    //ListItem lst = new ListItem("----Select Location----", "-1");
                    //ddlLocation.Items.Insert(0, lst);

                    foreach (ListItem _listItem in ddlLocation.Items)
                    {

                        _listItem.Attributes.Add("title", _listItem.Text + _listItem.Value);

                    }

                }
                else
                {
                    ddlLocation.Items.Clear();
                    //ListItem lst = new ListItem("----Select category----", "-1");
                    //ddlLocation.Items.Insert(0, lst);
                }
            }
        }


        public static DataSet GetEnquies(int type, string Location)
        {

            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@flag", SqlDbType.Int);
            arrParam[0].Value = type;
            arrParam[1] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[1].Value = Location;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetLastestEnquiry", arrParam);
            return ds;
        }

        public static void UpdtChangetoSuccess(int EnquiryID, int IsSolved)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("EnquiryID", SqlDbType.Int);
            arrParam[0].Value = EnquiryID;
            arrParam[1] = new SqlParameter("IsSolved", SqlDbType.Int);
            arrParam[1].Value = IsSolved;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdtChangeToSuccess", arrParam);

        }


        public static DataSet ViewProductDetail()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewProductDetail");
            return ds;
        }


        public static DataSet ViewProductDetailUpcomming()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewProductDetail_Upcomming");
            return ds;
        }



        public static void IsDeleteProduct(int ProductId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ProductId", SqlDbType.Int);
            arrParam[0].Value = ProductId;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_IsDeleteProduct", arrParam);

        }


        public static void UpdateProductDetail(string ProductName, string ProducerName, string DirectorName, string Refference, int ProductId)
        {
            SqlParameter[] arrParam = new SqlParameter[5];

            arrParam[0] = new SqlParameter("@ProductName", SqlDbType.VarChar);
            arrParam[0].Value = ProductName;

            arrParam[1] = new SqlParameter("@ProducerName", SqlDbType.VarChar);
            arrParam[1].Value = ProducerName;

            arrParam[2] = new SqlParameter("@DirectorName", SqlDbType.VarChar);
            arrParam[2].Value = DirectorName;

            arrParam[3] = new SqlParameter("@Refference", SqlDbType.VarChar);
            arrParam[3].Value = Refference;

            arrParam[4] = new SqlParameter("@Pid", SqlDbType.Int);
            arrParam[4].Value = ProductId;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateProductDetail", arrParam);
        }


        public static string[] GetProductByID(int ProductId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@ProductId", SqlDbType.Int);
            arrParam[0].Value = ProductId;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetProductById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;

        }



        public static void ArtistInfo(string Artist_Name, string Address, string Contact_No, string Commitment, string Feedback)
        {
            SqlParameter[] arrParam = new SqlParameter[5];
            arrParam[0] = new SqlParameter("@ArtistName", SqlDbType.VarChar);
            arrParam[0].Value = Artist_Name;
            arrParam[1] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[1].Value = Address;
            arrParam[2] = new SqlParameter("@ContactNo", SqlDbType.VarChar);
            arrParam[2].Value = Contact_No;
            arrParam[3] = new SqlParameter("@Commitment", SqlDbType.VarChar);
            arrParam[3].Value = Commitment;
            arrParam[4] = new SqlParameter("@Feedback", SqlDbType.VarChar);
            arrParam[4].Value = Feedback;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertArtistInfo", arrParam);
        }

        public static void updateAssgnLoc(string AssingLoc, int Eid)
        {
            SqlParameter[] arrParam = new SqlParameter[4];
            arrParam[0] = new SqlParameter("@AssingLoc", SqlDbType.VarChar);
            arrParam[0].Value = AssingLoc;
            arrParam[1] = new SqlParameter("@Eid", SqlDbType.Int);
            arrParam[1].Value = Eid;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateAssigLocatin", arrParam);

        }



        public static string Production_Team(string PCN, string Register_with, string Registration_Number,
            string Incorporate_Date, string Registration_Address, string Corporation_Address, string Contact_Number,
            string Emailid, string _Producer, string Associate_Producer, string Investor_Company_Name,
            string Investor_Name, string Presented_B_N, string B_Lakh, string B_Cr, string TOP)
        {
            SqlParameter[] arrParam = new SqlParameter[16];
            arrParam[0] = new SqlParameter("@ProductionCompanyName", SqlDbType.VarChar);
            arrParam[0].Value = PCN;
            arrParam[1] = new SqlParameter("@RegisterWith", SqlDbType.VarChar);
            arrParam[1].Value = Register_with;
            arrParam[2] = new SqlParameter("@RegistrationNumber", SqlDbType.VarChar);
            arrParam[2].Value = Registration_Number;
            arrParam[3] = new SqlParameter("@IncorporateDate", SqlDbType.VarChar);
            arrParam[3].Value = Incorporate_Date;
            arrParam[4] = new SqlParameter("@RegistrationAddress", SqlDbType.VarChar);
            arrParam[4].Value = Registration_Address;
            arrParam[5] = new SqlParameter("@CorporationAddress", SqlDbType.VarChar);
            arrParam[5].Value = Corporation_Address;
            arrParam[6] = new SqlParameter("@ContactNumber", SqlDbType.VarChar);
            arrParam[6].Value = Contact_Number;
            arrParam[7] = new SqlParameter("@EmailId", SqlDbType.VarChar);
            arrParam[7].Value = Emailid;
            arrParam[8] = new SqlParameter("@Producer", SqlDbType.VarChar);
            arrParam[8].Value = _Producer;
            arrParam[9] = new SqlParameter("@AssociateProducer", SqlDbType.VarChar);
            arrParam[9].Value = Associate_Producer;
            arrParam[10] = new SqlParameter("@InvestorCompanyName", SqlDbType.VarChar);
            arrParam[10].Value = Investor_Company_Name;
            arrParam[11] = new SqlParameter("@InvestorName", SqlDbType.VarChar);
            arrParam[11].Value = Investor_Name;
            arrParam[12] = new SqlParameter("@PresentedBannerName", SqlDbType.VarChar);
            arrParam[12].Value = Presented_B_N;
            arrParam[13] = new SqlParameter("@BudgetLakh", SqlDbType.VarChar);
            arrParam[13].Value = B_Lakh;
            arrParam[14] = new SqlParameter("@BudgetCr", SqlDbType.VarChar);
            arrParam[14].Value = B_Cr;
            arrParam[15] = new SqlParameter("@TOP", SqlDbType.VarChar);
            arrParam[15].Value = TOP;

            string TeamId = Convert.ToString(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_InsertProductionTeam", arrParam));

            SqlParameter[] arrParam2 = new SqlParameter[1];
            arrParam2[0] = new SqlParameter("@TeamId", SqlDbType.VarChar);
            arrParam2[0].Value = TeamId;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertTeam", arrParam2);

            return TeamId;

        }




        public static void Hire_Equipments(string Company_Name, string Authority_Name, string _Address, string Title_Of_Production, string Language_Of_Production, string mot, string Equipment_Location, string Period_Of_Production, string Start_Date, string End_Date, string Total_Days, string delHr, string delMin, string delAmPm, string recHr, string recMin, string recAmPm, string _Hire_Equipment, string Payment_Mode, string _Cash, string Cheque_No, string Amount_Cheque, string _Balance)
        {
            SqlParameter[] arrParam = new SqlParameter[23];
            arrParam[0] = new SqlParameter("@EquipmentLocation", SqlDbType.VarChar);
            arrParam[0].Value = Equipment_Location;
            arrParam[1] = new SqlParameter("@PeriodOfProduction", SqlDbType.VarChar);
            arrParam[1].Value = Period_Of_Production;
            arrParam[2] = new SqlParameter("@StartDate", SqlDbType.VarChar);
            arrParam[2].Value = Start_Date;
            arrParam[3] = new SqlParameter("@EndDate", SqlDbType.VarChar);
            arrParam[3].Value = End_Date;
            arrParam[4] = new SqlParameter("@TotalDays", SqlDbType.VarChar);
            arrParam[4].Value = Total_Days;
            arrParam[5] = new SqlParameter("@HireEquipment", SqlDbType.VarChar);
            arrParam[5].Value = _Hire_Equipment;
            arrParam[6] = new SqlParameter("@PaymentMode", SqlDbType.VarChar);
            arrParam[6].Value = Payment_Mode;
            arrParam[7] = new SqlParameter("@Cash", SqlDbType.VarChar);
            arrParam[7].Value = _Cash;
            arrParam[8] = new SqlParameter("@ChequeNo", SqlDbType.VarChar);
            arrParam[8].Value = Cheque_No;
            arrParam[9] = new SqlParameter("@AmountOnCheque", SqlDbType.VarChar);
            arrParam[9].Value = Amount_Cheque;
            arrParam[10] = new SqlParameter("@Balance", SqlDbType.VarChar);
            arrParam[10].Value = _Balance;
            arrParam[11] = new SqlParameter("@CompanyName", SqlDbType.VarChar);
            arrParam[11].Value = Company_Name;
            arrParam[12] = new SqlParameter("@AuthorityName", SqlDbType.VarChar);
            arrParam[12].Value = Authority_Name;
            arrParam[13] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[13].Value = _Address;
            arrParam[14] = new SqlParameter("@TitleOfProduction", SqlDbType.VarChar);
            arrParam[14].Value = Title_Of_Production;
            arrParam[15] = new SqlParameter("@LanguageOfProduction", SqlDbType.VarChar);
            arrParam[15].Value = Language_Of_Production;
            arrParam[16] = new SqlParameter("@Mot", SqlDbType.VarChar);
            arrParam[16].Value = mot;
            arrParam[17] = new SqlParameter("@DelHr", SqlDbType.VarChar);
            arrParam[17].Value = delHr;
            arrParam[18] = new SqlParameter("@DelMin", SqlDbType.VarChar);
            arrParam[18].Value = delMin;
            arrParam[19] = new SqlParameter("@DelAmPm", SqlDbType.VarChar);
            arrParam[19].Value = delAmPm;
            arrParam[20] = new SqlParameter("@RecHr", SqlDbType.VarChar);
            arrParam[20].Value = recHr;
            arrParam[21] = new SqlParameter("@RecMin", SqlDbType.VarChar);
            arrParam[21].Value = recMin;
            arrParam[22] = new SqlParameter("@RecAmPm", SqlDbType.VarChar);
            arrParam[22].Value = recAmPm;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertHireEquipment", arrParam);
        }

        public static DataSet ViewllEquipments()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewHireEquipment");
            return ds;
        }

        public static string[] GetHireEquipmentById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@HireId", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetHireEquipmentById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static string[] GetArtistInfoById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@ArtistID", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetArtistInfoById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;

        }

        public static DataSet ViewAllArtists()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewArtistInfo");
            return ds;
        }

        public static string[] GetProductionTeamById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@ProductionTeamId", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_ProductionTeamById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static DataSet ViewAllProductionTeam()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ProductionTeam");
            return ds;
        }

        public static void InsertProduct(string ProductName, string ProducerName, string DirectorName, string TypeOfFilm,
            string AudDate, string AudHr, string AudMin, string AudAmPm, string RefName, string RefContact,
            string ReqFor, string AgeFrm, string AgeTo, string TypeOfArtist)
        {
            SqlParameter[] arrParam = new SqlParameter[14];
            arrParam[0] = new SqlParameter("@ProductName", SqlDbType.VarChar);
            arrParam[0].Value = ProductName;
            arrParam[1] = new SqlParameter("@ProducerName", SqlDbType.VarChar);
            arrParam[1].Value = ProducerName;
            arrParam[2] = new SqlParameter("@DirectorName", SqlDbType.VarChar);
            arrParam[2].Value = DirectorName;
            arrParam[3] = new SqlParameter("@TypeOfFilm", SqlDbType.VarChar);
            arrParam[3].Value = TypeOfFilm;
            arrParam[4] = new SqlParameter("@AudDate", SqlDbType.VarChar);
            arrParam[4].Value = AudDate;
            arrParam[5] = new SqlParameter("@AudHr", SqlDbType.VarChar);
            arrParam[5].Value = AudHr;
            arrParam[6] = new SqlParameter("@AudMin", SqlDbType.VarChar);
            arrParam[6].Value = AudMin;
            arrParam[7] = new SqlParameter("@AudAmPm", SqlDbType.VarChar);
            arrParam[7].Value = AudAmPm;
            arrParam[8] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[8].Value = RefName;
            arrParam[9] = new SqlParameter("@RefContact", SqlDbType.VarChar);
            arrParam[9].Value = RefContact;
            arrParam[10] = new SqlParameter("@ReqFor", SqlDbType.VarChar);
            arrParam[10].Value = ReqFor;
            arrParam[11] = new SqlParameter("@AgeFrm", SqlDbType.VarChar);
            arrParam[11].Value = AgeFrm;
            arrParam[12] = new SqlParameter("@AgeTo", SqlDbType.VarChar);
            arrParam[12].Value = AgeTo;
            arrParam[13] = new SqlParameter("@TypeOfArtist", SqlDbType.VarChar);
            arrParam[13].Value = TypeOfArtist;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertProduct", arrParam);
        }


        public static void Team(string Director_Name, string _Writer, string Casting_Director, string Marketing_Head,
            string Creative_Director, string Music_Director, string Dance_Director, string Art_Director,
            string Fashion_Designer, string Executive_Producer, string _Dop, string Production_Manager,
            string Assistant_Director, string Head_Media_Manager, int Productoin_TeamId, string supplier)
        {


            SqlParameter[] arrParam = new SqlParameter[16];
            arrParam[0] = new SqlParameter("@DirectorName", SqlDbType.VarChar);
            arrParam[0].Value = Director_Name;
            arrParam[1] = new SqlParameter("@Writer", SqlDbType.VarChar);
            arrParam[1].Value = _Writer;
            arrParam[2] = new SqlParameter("@CastingDirector", SqlDbType.VarChar);
            arrParam[2].Value = Casting_Director;
            arrParam[3] = new SqlParameter("@MarketingHead", SqlDbType.VarChar);
            arrParam[3].Value = Marketing_Head;
            arrParam[4] = new SqlParameter("@CreativeDirector", SqlDbType.VarChar);
            arrParam[4].Value = Creative_Director;
            arrParam[5] = new SqlParameter("@MusicDirector", SqlDbType.VarChar);
            arrParam[5].Value = Music_Director;
            arrParam[6] = new SqlParameter("@DanceDirector", SqlDbType.VarChar);
            arrParam[6].Value = Dance_Director;
            arrParam[7] = new SqlParameter("@ArtDirector", SqlDbType.VarChar);
            arrParam[7].Value = Art_Director;
            arrParam[8] = new SqlParameter("@FashionDesigner", SqlDbType.VarChar);
            arrParam[8].Value = Fashion_Designer;
            arrParam[9] = new SqlParameter("@ExecutiveProducer", SqlDbType.VarChar);
            arrParam[9].Value = Executive_Producer;
            arrParam[10] = new SqlParameter("@Dop", SqlDbType.VarChar);
            arrParam[10].Value = _Dop;
            arrParam[11] = new SqlParameter("@ProductionManager", SqlDbType.VarChar);
            arrParam[11].Value = Production_Manager;
            arrParam[12] = new SqlParameter("@AssistantDirector", SqlDbType.VarChar);
            arrParam[12].Value = Assistant_Director;
            arrParam[13] = new SqlParameter("@HeadMediaManager", SqlDbType.VarChar);
            arrParam[13].Value = Head_Media_Manager;
            arrParam[14] = new SqlParameter("@Productoin_TeamId", SqlDbType.Int);
            arrParam[14].Value = Productoin_TeamId;
            arrParam[15] = new SqlParameter("@supplier", SqlDbType.VarChar);
            arrParam[15].Value = supplier;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateStep2Team", arrParam);

        }

        public static void Audition_Sheet(string ProductName, string TitleOfProduction, string AudiDate,
            string TypeOfProduction, string CastingDirectorName, string Contact, string Address)
        {
            SqlParameter[] arrParam = new SqlParameter[7];
            arrParam[0] = new SqlParameter("@Product_Name", SqlDbType.VarChar);
            arrParam[0].Value = ProductName;
            arrParam[1] = new SqlParameter("@Title_Of_Production", SqlDbType.VarChar);
            arrParam[1].Value = TitleOfProduction;
            arrParam[2] = new SqlParameter("@Audition_Date", SqlDbType.VarChar);
            arrParam[2].Value = AudiDate;
            arrParam[3] = new SqlParameter("@Type_Of_Production", SqlDbType.VarChar);
            arrParam[3].Value = TypeOfProduction;
            arrParam[4] = new SqlParameter("@Casting_Director_Name", SqlDbType.VarChar);
            arrParam[4].Value = CastingDirectorName;
            arrParam[5] = new SqlParameter("@Contact", SqlDbType.VarChar);
            arrParam[5].Value = Contact;
            arrParam[6] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[6].Value = Address;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertAuditionSheet", arrParam);



        }

        public static void AuditionSheetDetails(DateTime AuditoinDate, string ProductionName, string TitleProduction, string TypeProduction, string CastingDirectName, string ContNo, string Address , string  hr ,string  min ,string  ampm)
        {
            SqlParameter[] arrParam = new SqlParameter[10];
            arrParam[0] = new SqlParameter("@AuditoinDate", SqlDbType.DateTime);
            arrParam[0].Value = AuditoinDate;
            arrParam[1] = new SqlParameter("@ProductionName", SqlDbType.VarChar);
            arrParam[1].Value = ProductionName;
            arrParam[2] = new SqlParameter("@TitleProduction", SqlDbType.VarChar);
            arrParam[2].Value = TitleProduction;
            arrParam[3] = new SqlParameter("@TypeProduction", SqlDbType.VarChar);
            arrParam[3].Value = TypeProduction;
            arrParam[4] = new SqlParameter("@CastingDirectName", SqlDbType.VarChar);
            arrParam[4].Value = CastingDirectName;
            arrParam[5] = new SqlParameter("@ContNo", SqlDbType.VarChar);
            arrParam[5].Value = ContNo;
            arrParam[6] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[6].Value = Address;
            arrParam[7] = new SqlParameter("@Hr", SqlDbType.VarChar);
            arrParam[7].Value = hr;
            arrParam[8] = new SqlParameter("@Min", SqlDbType.VarChar);
            arrParam[8].Value = min;
            arrParam[9] = new SqlParameter("@AmPm", SqlDbType.VarChar);
            arrParam[9].Value = ampm;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertAudiSheetDetails", arrParam);





        }

        public static DataSet ViewAllAudtionSheetDetails()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewAuditionSheetDetails");
            return ds;

        }

        public static void InsertAuditionArtist(string AuditionID, string ArtistName, DateTime Bdate, string Address,
            string ContNo, string Commitment,
            string location, string referto, string feedback)
        {
            SqlParameter[] arrParam = new SqlParameter[9];
            arrParam[0] = new SqlParameter("@AuditionID", SqlDbType.Int);
            arrParam[0].Value = AuditionID;
            arrParam[1] = new SqlParameter("@ArtistName", SqlDbType.VarChar);
            arrParam[1].Value = ArtistName;
            arrParam[2] = new SqlParameter("@Bdate", SqlDbType.DateTime);
            arrParam[2].Value = Bdate;
            arrParam[3] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[3].Value = Address;
            arrParam[4] = new SqlParameter("@ContNo", SqlDbType.VarChar);
            arrParam[4].Value = ContNo;
            arrParam[5] = new SqlParameter("@Commitment", SqlDbType.VarChar);
            arrParam[5].Value = Commitment;
            arrParam[6] = new SqlParameter("@location", SqlDbType.VarChar);
            arrParam[6].Value = location;
            arrParam[7] = new SqlParameter("@referto", SqlDbType.VarChar);
            arrParam[7].Value = referto;
            arrParam[8] = new SqlParameter("@feedback", SqlDbType.VarChar);
            arrParam[8].Value = feedback;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertAudtionArtist", arrParam);




        }

        public static DataSet viewallAudtionArtist(int AudiID)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@AudiID", SqlDbType.Int);
            arrParam[0].Value = AudiID;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewAuditionArtists", arrParam);
            return ds;
        }



        public static string[] GetAudtionArtistById(int ArtistID)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@ArtistID", SqlDbType.Int);
            arrParam[0].Value = ArtistID;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetAudiArtistById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;


        }

        public static void Lead_Generator(string Name, string Contact, string Location, string Email,
            string InterestedField, string EnquiryType, string FollowUp, string Feedback, string Status,
            string UnSolvedReason, string Transfer, string RefName, string RefContact , string BGC)
        {
            SqlParameter[] arrParam = new SqlParameter[14];

            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Contact", SqlDbType.VarChar);
            arrParam[1].Value = Contact;
            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Location;
            arrParam[3] = new SqlParameter("@Email", SqlDbType.VarChar);
            arrParam[3].Value = Email;
            arrParam[4] = new SqlParameter("@InterestedField", SqlDbType.VarChar);
            arrParam[4].Value = InterestedField;
            arrParam[5] = new SqlParameter("@EnquiryType", SqlDbType.VarChar);
            arrParam[5].Value = EnquiryType;
            arrParam[6] = new SqlParameter("@FollowUp", SqlDbType.VarChar);
            arrParam[6].Value = FollowUp;
            arrParam[7] = new SqlParameter("@Feedback", SqlDbType.VarChar);
            arrParam[7].Value = Feedback;
            arrParam[8] = new SqlParameter("@Status", SqlDbType.VarChar);
            arrParam[8].Value = Status;
            arrParam[9] = new SqlParameter("@UnSolvedReason", SqlDbType.VarChar);
            arrParam[9].Value = UnSolvedReason;
            arrParam[10] = new SqlParameter("@Transfer", SqlDbType.VarChar);
            arrParam[10].Value = Transfer;
            arrParam[11] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[11].Value = RefName;
            arrParam[12] = new SqlParameter("@RefContact", SqlDbType.VarChar);
            arrParam[12].Value = RefContact;
            arrParam[13] = new SqlParameter("@BGC", SqlDbType.VarChar);
            arrParam[13].Value = BGC;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_LeadGeneration", arrParam);


        }

        public static DataSet viewAllLead()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_ViewLeadInfo");
            return ds;
        }

        public static string[] GetLeadById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@LeadId", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetLeadInfoById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static void UpdateProductionTeam(string PCN, string Register_with, string Registration_Number,
            string Incorporate_Date, string Registration_Address, string Corporation_Address, string Contact_Number,
            string Emailid, string _Producer, string Associate_Producer, string Investor_Company_Name,
            string Investor_Name, string Presented_B_N, string B_Lakh, string B_Cr, string Director_Name,
            string _Writer, string Casting_Director, string Marketing_Head, string Creative_Director,
            string Music_Director, string Dance_Director, string Art_Director, string Fashion_Designer,
            string Executive_Producer, string _Dop, string Production_Manager, string Assistant_Director,
            string Head_Media_Manager, string supplier, string production_Team_Id_Update, string TOP)
        {

            SqlParameter[] arrParam = new SqlParameter[32];
            arrParam[0] = new SqlParameter("@ProductionCompanyName", SqlDbType.VarChar);
            arrParam[0].Value = PCN;
            arrParam[1] = new SqlParameter("@RegisterWith", SqlDbType.VarChar);
            arrParam[1].Value = Register_with;
            arrParam[2] = new SqlParameter("@RegistrationNumber", SqlDbType.VarChar);
            arrParam[2].Value = Registration_Number;
            arrParam[3] = new SqlParameter("@IncorporateDate", SqlDbType.VarChar);
            arrParam[3].Value = Incorporate_Date;
            arrParam[4] = new SqlParameter("@RegistrationAddress", SqlDbType.VarChar);
            arrParam[4].Value = Registration_Address;
            arrParam[5] = new SqlParameter("@CorporationAddress", SqlDbType.VarChar);
            arrParam[5].Value = Corporation_Address;
            arrParam[6] = new SqlParameter("@ContactNumber", SqlDbType.VarChar);
            arrParam[6].Value = Contact_Number;
            arrParam[7] = new SqlParameter("@EmailId", SqlDbType.VarChar);
            arrParam[7].Value = Emailid;
            arrParam[8] = new SqlParameter("@Producer", SqlDbType.VarChar);
            arrParam[8].Value = _Producer;
            arrParam[9] = new SqlParameter("@AssociateProducer", SqlDbType.VarChar);
            arrParam[9].Value = Associate_Producer;
            arrParam[10] = new SqlParameter("@InvestorCompanyName", SqlDbType.VarChar);
            arrParam[10].Value = Investor_Company_Name;
            arrParam[11] = new SqlParameter("@InvestorName", SqlDbType.VarChar);
            arrParam[11].Value = Investor_Name;
            arrParam[12] = new SqlParameter("@PresentedBannerName", SqlDbType.VarChar);
            arrParam[12].Value = Presented_B_N;
            arrParam[13] = new SqlParameter("@BudgetLakh", SqlDbType.VarChar);
            arrParam[13].Value = B_Lakh;
            arrParam[14] = new SqlParameter("@BudgetCr", SqlDbType.VarChar);
            arrParam[14].Value = B_Cr;

            arrParam[15] = new SqlParameter("@DirectorName", SqlDbType.VarChar);
            arrParam[15].Value = Director_Name;
            arrParam[16] = new SqlParameter("@Writer", SqlDbType.VarChar);
            arrParam[16].Value = _Writer;
            arrParam[17] = new SqlParameter("@CastingDirector", SqlDbType.VarChar);
            arrParam[17].Value = Casting_Director;
            arrParam[18] = new SqlParameter("@MarketingHead", SqlDbType.VarChar);
            arrParam[18].Value = Marketing_Head;
            arrParam[19] = new SqlParameter("@CreativeDirector", SqlDbType.VarChar);
            arrParam[19].Value = Creative_Director;
            arrParam[20] = new SqlParameter("@MusicDirector", SqlDbType.VarChar);
            arrParam[20].Value = Music_Director;
            arrParam[21] = new SqlParameter("@DanceDirector", SqlDbType.VarChar);
            arrParam[21].Value = Dance_Director;
            arrParam[22] = new SqlParameter("@ArtDirector", SqlDbType.VarChar);
            arrParam[22].Value = Art_Director;
            arrParam[23] = new SqlParameter("@FashionDesigner", SqlDbType.VarChar);
            arrParam[23].Value = Fashion_Designer;
            arrParam[24] = new SqlParameter("@ExecutiveProducer", SqlDbType.VarChar);
            arrParam[24].Value = Executive_Producer;
            arrParam[25] = new SqlParameter("@Dop", SqlDbType.VarChar);
            arrParam[25].Value = _Dop;
            arrParam[26] = new SqlParameter("@ProductionManager", SqlDbType.VarChar);
            arrParam[26].Value = Production_Manager;
            arrParam[27] = new SqlParameter("@AssistantDirector", SqlDbType.VarChar);
            arrParam[27].Value = Assistant_Director;
            arrParam[28] = new SqlParameter("@HeadMediaManager", SqlDbType.VarChar);
            arrParam[28].Value = Head_Media_Manager;
            arrParam[29] = new SqlParameter("@supplier", SqlDbType.VarChar);
            arrParam[29].Value = supplier;
            arrParam[30] = new SqlParameter("@Production_Team_Id", SqlDbType.VarChar);
            arrParam[30].Value = production_Team_Id_Update;
            arrParam[31] = new SqlParameter("@TOP", SqlDbType.VarChar);
            arrParam[31].Value = TOP;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Production_Team", arrParam);

        }

        public static void Update_Lead_Generator(string Id, string Name, string Contact, string Location, string Email,
            string InterestedField, string EnquiryType, string Feedback, string Status, string Transfer, string RefName,
            string RefContact , string BGC)
        {

            SqlParameter[] arrParam = new SqlParameter[13];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Contact", SqlDbType.VarChar);
            arrParam[1].Value = Contact;
            arrParam[2] = new SqlParameter("@Location", SqlDbType.VarChar);
            arrParam[2].Value = Location;
            arrParam[3] = new SqlParameter("@Email", SqlDbType.VarChar);
            arrParam[3].Value = Email;
            arrParam[4] = new SqlParameter("@InterestedField", SqlDbType.VarChar);
            arrParam[4].Value = InterestedField;
            arrParam[5] = new SqlParameter("@EnquiryType", SqlDbType.VarChar);
            arrParam[5].Value = EnquiryType;
            arrParam[6] = new SqlParameter("@Feedback", SqlDbType.VarChar);
            arrParam[6].Value = Feedback;
            arrParam[7] = new SqlParameter("@Status", SqlDbType.VarChar);
            arrParam[7].Value = Status;
            arrParam[8] = new SqlParameter("@Transfer", SqlDbType.VarChar);
            arrParam[8].Value = Transfer;
            arrParam[9] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[9].Value = RefName;
            arrParam[10] = new SqlParameter("@RefContact", SqlDbType.VarChar);
            arrParam[10].Value = RefContact;
            arrParam[11] = new SqlParameter("@LeadId", SqlDbType.VarChar);
            arrParam[11].Value = Id;
            arrParam[12] = new SqlParameter("@BGC", SqlDbType.VarChar);
            arrParam[12].Value = BGC;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Lead_Generation", arrParam);


        }

        public static void DeleteLeadById(int Cid)
        {

            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@LeadId", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Lead_Generation", arrParam);


        }

        public static void DeleteProductionTeamById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ProductionTeamId", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_All_Production_Team", arrParam);

        }

        public static void DeleteProductById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@ProductID", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Product_By_Id", arrParam);

        }

        public static void Update_Add_Audition(string ProductId, string ProductName, string ProducerName, string DirectorName, string TypeOfFilm, string AudDate, string AudHr, string AudMin, string AudAmPm, string RefName, string RefContact, string ReqFor, string AgeFrm, string AgeTo, string TypeOfArtist)
        {
            SqlParameter[] arrParam = new SqlParameter[15];
            arrParam[0] = new SqlParameter("@ProductName", SqlDbType.VarChar);
            arrParam[0].Value = ProductName;
            arrParam[1] = new SqlParameter("@ProducerName", SqlDbType.VarChar);
            arrParam[1].Value = ProducerName;
            arrParam[2] = new SqlParameter("@DirectorName", SqlDbType.VarChar);
            arrParam[2].Value = DirectorName;
            arrParam[3] = new SqlParameter("@TypeOfFilm", SqlDbType.VarChar);
            arrParam[3].Value = TypeOfFilm;
            arrParam[4] = new SqlParameter("@AudDate", SqlDbType.VarChar);
            arrParam[4].Value = AudDate;
            arrParam[5] = new SqlParameter("@AudHr", SqlDbType.VarChar);
            arrParam[5].Value = AudHr;
            arrParam[6] = new SqlParameter("@AudMin", SqlDbType.VarChar);
            arrParam[6].Value = AudMin;
            arrParam[7] = new SqlParameter("@AudAmPm", SqlDbType.VarChar);
            arrParam[7].Value = AudAmPm;
            arrParam[8] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[8].Value = RefName;
            arrParam[9] = new SqlParameter("@RefContact", SqlDbType.VarChar);
            arrParam[9].Value = RefContact;
            arrParam[10] = new SqlParameter("@ReqFor", SqlDbType.VarChar);
            arrParam[10].Value = ReqFor;
            arrParam[11] = new SqlParameter("@AgeFrm", SqlDbType.VarChar);
            arrParam[11].Value = AgeFrm;
            arrParam[12] = new SqlParameter("@AgeTo", SqlDbType.VarChar);
            arrParam[12].Value = AgeTo;
            arrParam[13] = new SqlParameter("@TypeOfArtist", SqlDbType.VarChar);
            arrParam[13].Value = TypeOfArtist;
            arrParam[14] = new SqlParameter("@ProductId", SqlDbType.VarChar);
            arrParam[14].Value = ProductId;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Product_By_Id", arrParam);
        }

        public static void DeleteHireEquipById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@HireId", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Hire_Equipment_By_Id", arrParam);

        }

        public static void Update_Hire_Equipments(string HireId, string Company_Name, string Authority_Name,
            string _Address, string Title_Of_Production, string Language_Of_Production, string mot,
            string Equipment_Location, string Period_Of_Production, string Start_Date, string End_Date,
            string Total_Days, string delHr, string delMin, string delAmPm, string recHr, string recMin,
            string recAmPm, string _Hire_Equipment, string Payment_Mode, string _Cash, string Cheque_No,
            string Amount_Cheque, string _Balance)
        {
            SqlParameter[] arrParam = new SqlParameter[24];
            arrParam[0] = new SqlParameter("@EquipmentLocation", SqlDbType.VarChar);
            arrParam[0].Value = Equipment_Location;
            arrParam[1] = new SqlParameter("@PeriodOfProduction", SqlDbType.VarChar);
            arrParam[1].Value = Period_Of_Production;
            arrParam[2] = new SqlParameter("@StartDate", SqlDbType.VarChar);
            arrParam[2].Value = Start_Date;
            arrParam[3] = new SqlParameter("@EndDate", SqlDbType.VarChar);
            arrParam[3].Value = End_Date;
            arrParam[4] = new SqlParameter("@TotalDays", SqlDbType.VarChar);
            arrParam[4].Value = Total_Days;
            arrParam[5] = new SqlParameter("@HireEquipment", SqlDbType.VarChar);
            arrParam[5].Value = _Hire_Equipment;
            arrParam[6] = new SqlParameter("@PaymentMode", SqlDbType.VarChar);
            arrParam[6].Value = Payment_Mode;
            arrParam[7] = new SqlParameter("@Cash", SqlDbType.VarChar);
            arrParam[7].Value = _Cash;
            arrParam[8] = new SqlParameter("@ChequeNo", SqlDbType.VarChar);
            arrParam[8].Value = Cheque_No;
            arrParam[9] = new SqlParameter("@AmountOnCheque", SqlDbType.VarChar);
            arrParam[9].Value = Amount_Cheque;
            arrParam[10] = new SqlParameter("@Balance", SqlDbType.VarChar);
            arrParam[10].Value = _Balance;
            arrParam[11] = new SqlParameter("@CompanyName", SqlDbType.VarChar);
            arrParam[11].Value = Company_Name;
            arrParam[12] = new SqlParameter("@AuthorityName", SqlDbType.VarChar);
            arrParam[12].Value = Authority_Name;
            arrParam[13] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[13].Value = _Address;
            arrParam[14] = new SqlParameter("@TitleOfProduction", SqlDbType.VarChar);
            arrParam[14].Value = Title_Of_Production;
            arrParam[15] = new SqlParameter("@LanguageOfProduction", SqlDbType.VarChar);
            arrParam[15].Value = Language_Of_Production;
            arrParam[16] = new SqlParameter("@Mot", SqlDbType.VarChar);
            arrParam[16].Value = mot;
            arrParam[17] = new SqlParameter("@DelHr", SqlDbType.VarChar);
            arrParam[17].Value = delHr;
            arrParam[18] = new SqlParameter("@DelMin", SqlDbType.VarChar);
            arrParam[18].Value = delMin;
            arrParam[19] = new SqlParameter("@DelAmPm", SqlDbType.VarChar);
            arrParam[19].Value = delAmPm;
            arrParam[20] = new SqlParameter("@RecHr", SqlDbType.VarChar);
            arrParam[20].Value = recHr;
            arrParam[21] = new SqlParameter("@RecMin", SqlDbType.VarChar);
            arrParam[21].Value = recMin;
            arrParam[22] = new SqlParameter("@RecAmPm", SqlDbType.VarChar);
            arrParam[22].Value = recAmPm;
            arrParam[23] = new SqlParameter("@HireId", SqlDbType.VarChar);
            arrParam[23].Value = HireId;



            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Hire_Equipment", arrParam);
        }


        public static DataSet SearchHireEquipment(string columnName, string Value)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@columnName", SqlDbType.VarChar);
            arrParam[0].Value = columnName;
            arrParam[1] = new SqlParameter("@Value", SqlDbType.VarChar);
            arrParam[1].Value = Value;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_Search_Hire_Equipment", arrParam);
            return ds;
        }

        public static string[] GetAuditionSheetById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@AudtionID", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_Get_Audition_Sheet_By_Id", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static void DeleteAuditionSheetDetailById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@AudtionID", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Audiotion_Sheet_Data_By_Id", arrParam);

        }

        public static void UpdateAuditionSheetDetails(string AudtionID, DateTime AuditoinDate, string ProductionName, string TitleProduction,
            string TypeProduction, string CastingDirectName, string ContNo, string Address , string hr , string  min , string ampm)
        {
            SqlParameter[] arrParam = new SqlParameter[11];
            arrParam[0] = new SqlParameter("@AuditoinDate", SqlDbType.DateTime);
            arrParam[0].Value = AuditoinDate;
            arrParam[1] = new SqlParameter("@ProductionName", SqlDbType.VarChar);
            arrParam[1].Value = ProductionName;
            arrParam[2] = new SqlParameter("@TitleProduction", SqlDbType.VarChar);
            arrParam[2].Value = TitleProduction;
            arrParam[3] = new SqlParameter("@TypeProduction", SqlDbType.VarChar);
            arrParam[3].Value = TypeProduction;
            arrParam[4] = new SqlParameter("@CastingDirectName", SqlDbType.VarChar);
            arrParam[4].Value = CastingDirectName;
            arrParam[5] = new SqlParameter("@ContNo", SqlDbType.VarChar);
            arrParam[5].Value = ContNo;
            arrParam[6] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[6].Value = Address;
            arrParam[7] = new SqlParameter("@AudtionID", SqlDbType.VarChar);
            arrParam[7].Value = AudtionID;      
            arrParam[8] = new SqlParameter("@Hr", SqlDbType.VarChar);
            arrParam[8].Value = hr;
            arrParam[9] = new SqlParameter("@Min", SqlDbType.VarChar);
            arrParam[9].Value = min;
            arrParam[10] = new SqlParameter("@AmPm", SqlDbType.VarChar);
            arrParam[10].Value = ampm;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_AudiSheet_Details", arrParam);

        }

        public static void DeleteAudtionArtistById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@AudtionArtistID", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Audiotion_Artist_By_Id", arrParam);

        }

        public static void UpdateAuditionArtist(string AuditionID, string ArtistName, string Bdate, string Address, string ContNo, string Commitment, string location, string referto, string feedback)
        {
            SqlParameter[] arrParam = new SqlParameter[9];
            arrParam[0] = new SqlParameter("@AuditionID", SqlDbType.Int);
            arrParam[0].Value = AuditionID;
            arrParam[1] = new SqlParameter("@ArtistName", SqlDbType.VarChar);
            arrParam[1].Value = ArtistName;
            arrParam[2] = new SqlParameter("@Bdate", SqlDbType.VarChar);
            arrParam[2].Value = Bdate;
            arrParam[3] = new SqlParameter("@Address", SqlDbType.VarChar);
            arrParam[3].Value = Address;
            arrParam[4] = new SqlParameter("@ContNo", SqlDbType.VarChar);
            arrParam[4].Value = ContNo;
            arrParam[5] = new SqlParameter("@Commitment", SqlDbType.VarChar);
            arrParam[5].Value = Commitment;
            arrParam[6] = new SqlParameter("@location", SqlDbType.VarChar);
            arrParam[6].Value = location;
            arrParam[7] = new SqlParameter("@referto", SqlDbType.VarChar);
            arrParam[7].Value = referto;
            arrParam[8] = new SqlParameter("@feedback", SqlDbType.VarChar);
            arrParam[8].Value = feedback;

            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Audtion_Artist", arrParam);


        }

        public static DataSet SearchProductionTeam(string columnName, string Value)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@columnName", SqlDbType.VarChar);
            arrParam[0].Value = columnName;
            arrParam[1] = new SqlParameter("@Value", SqlDbType.VarChar);
            arrParam[1].Value = Value;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_Search_Production_Team", arrParam);
            return ds;
        }


        public static void PopulateLoc(ref DropDownList ddlLoc)
        {
            //objWsrComm = new WSRCommon.WSCommon();
            //DataSet ds = objWsrComm.GetCityList();
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, "CT_GetLocationMaster");
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlLoc.DataSource = ds.Tables[0];

                    ddlLoc.DataTextField = "Location";
                    ddlLoc.DataValueField = "Location";
                    ddlLoc.DataBind();

                    //ListItem lst = new ListItem("----Select Location----", "-1");
                    //ddlLoc.Items.Insert(0, lst);

                    foreach (ListItem _listItem in ddlLoc.Items)
                    {

                        _listItem.Attributes.Add("title", _listItem.Text + _listItem.Value);

                    }

                }
                else
                {
                    ddlLoc.Items.Clear();
                    //ListItem lst = new ListItem("----Select category----", "-1");
                    //ddlLoc.Items.Insert(0, lst);
                }
            }
        }
     
    

        public static DataSet SearchLead(int Type, string SearchTxt)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@Type", SqlDbType.Int);
            arrParam[0].Value = Type;
            arrParam[1] = new SqlParameter("@SearchTxt", SqlDbType.VarChar);
            arrParam[1].Value = SearchTxt;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_SearchLead", arrParam);
            return ds;
        }

        public static DataSet SearchAudition(int Type, string SearchTxt)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@Type", SqlDbType.Int);
            arrParam[0].Value = Type;

            arrParam[1] = new SqlParameter("@SearchTxt", SqlDbType.VarChar);
            arrParam[1].Value = SearchTxt;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_SearchAudition", arrParam);
            return ds;

        }

        public static DataSet SearchAuditionUpcomming(int Type, string SearchTxt)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@Type", SqlDbType.Int);
            arrParam[0].Value = Type;

            arrParam[1] = new SqlParameter("@SearchTxt", SqlDbType.VarChar);
            arrParam[1].Value = SearchTxt;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_SearchAudition_Upcomming", arrParam);
            return ds;

        }



        public static void VCardApply(string Name, string EmpCode, string Designtn, string pic, string Contno, string Emailid, string UserId, string TechType)
        {
            SqlParameter[] arrParam = new SqlParameter[8];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@EmpCode", SqlDbType.VarChar);
            arrParam[1].Value = EmpCode;
            arrParam[2] = new SqlParameter("@Designtn", SqlDbType.VarChar);
            arrParam[2].Value = Designtn;
            arrParam[3] = new SqlParameter("@pic", SqlDbType.VarChar);
            arrParam[3].Value = pic;
            arrParam[4] = new SqlParameter("@Contno", SqlDbType.VarChar);
            arrParam[4].Value = Contno;
            arrParam[5] = new SqlParameter("@Emailid", SqlDbType.VarChar);
            arrParam[5].Value = Emailid;
            arrParam[6] = new SqlParameter("@UserId", SqlDbType.VarChar);
            arrParam[6].Value = UserId;
            arrParam[7] = new SqlParameter("@TechType", SqlDbType.VarChar);
            arrParam[7].Value = TechType;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_VisitingCardApply", arrParam);
        }

        public static int GetLevels(int UserId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            int lvl =Convert.ToInt32( CTEA_INDIA.DAL.SqlHelper.ExecuteScalar (con, CommandType.StoredProcedure, "CT_GetLevels",arrParam ));
            return lvl;
        }

        public static int GetLevelId(int UserId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            int lvl = Convert.ToInt32(CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_GetLevelsId", arrParam));
            return lvl;
        }


        public static DataSet  GetAllTechName()
        {

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetNamesforLevel");
            return ds;
        }


        public static void InsertDuggestion(string CommuType, string Details , string Id)
        {
            SqlParameter[] arrParam = new SqlParameter[3];
            arrParam[0] = new SqlParameter("@CommuType", SqlDbType.VarChar);
            arrParam[0].Value = CommuType;
            arrParam[1] = new SqlParameter("@Details", SqlDbType.VarChar);
            arrParam[1].Value = Details;
            arrParam[1] = new SqlParameter("@Id", SqlDbType.VarChar);
            arrParam[1].Value = Id;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_InsertSuggestion", arrParam);
        }

        public static void UploadImages(string fileName, int useri_id, string DescrImg)
        {
            SqlParameter[] arrParam = new SqlParameter[3];
            arrParam[0] = new SqlParameter("@fileName", SqlDbType.VarChar);
            arrParam[0].Value = fileName;
            arrParam[1] = new SqlParameter("@useri_id", SqlDbType.Int);
            arrParam[1].Value = useri_id;
           
            arrParam[2] = new SqlParameter("@DescrImg", SqlDbType.VarChar);
            arrParam[2].Value = DescrImg;

            CTEA_INDIA .DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UploadImage", arrParam);


        }
       
        public static DataSet PopulateVC(int Tectype)
        {

            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@Tectype", SqlDbType.Int);
            arrParam[0].Value = Tectype;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetVisitingCard",arrParam);
              return ds;
        }

        public static DataSet PopulateId(int Tectype)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@Tectype", SqlDbType.Int);
            arrParam[0].Value = Tectype;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetIdCard", arrParam);
            return ds;
        }

        public static void UpdateVCApprove(int VCid, int TechType)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@VCid", SqlDbType.Int);
            arrParam[0].Value = VCid;
            arrParam[1] = new SqlParameter("@TechType", SqlDbType.Int);
            arrParam[1].Value = TechType;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateVCard", arrParam);
      
        }


        public static void UpdateIdCardApprove(int VCid, int TechType)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@VCid", SqlDbType.Int);
            arrParam[0].Value = VCid;
            arrParam[1] = new SqlParameter("@TechType", SqlDbType.Int);
            arrParam[1].Value = TechType;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_UpdateId", arrParam);

        }

        public static DataSet ViewAllArtist_Cards()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_View_Artist_Card");
            return ds;
        }


        public static DataSet viewAllArtistPort(string catgory)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@Category", SqlDbType.VarChar);
            arrParam[0].Value = catgory;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_PortNew", arrParam);
            return ds;
        }

        public static DataSet GetImg(int UserId)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@UserId", SqlDbType.Int);
            arrParam[0].Value = UserId;
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_GetImages",arrParam );
            return ds;
        }


        public static string[] Get_Artist_Card_By_Id(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@Artist_Card_Id", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetArtistCardById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
            
        }

        public static void DeleteArtistCardById(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@Artist_Card_Id", SqlDbType.VarChar);
            arrParam[0].Value = Cid.ToString();
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Delete_Artist_Card_By_Id", arrParam);

        }

        public static int InsertArtistCardInfo(string Name, string Loc, string Addresss, string ArtsType, 
            string Category, string Techni_Type, string Date, string Validfrom, string validTo, string Email,
            string RefName, string ContctNo, string artistCno, string IDPic, string idProof, string AddProof, string Amount, string group , string DelTo , string PostalAddr)
        {
            SqlParameter[] arrParam = new SqlParameter[20];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Loc", SqlDbType.VarChar);
            arrParam[1].Value = Loc;
            arrParam[2] = new SqlParameter("@Addresss", SqlDbType.VarChar);
            arrParam[2].Value = Addresss;
            arrParam[3] = new SqlParameter("@ArtsType", SqlDbType.VarChar);
            arrParam[3].Value = ArtsType;
            arrParam[4] = new SqlParameter("@Category", SqlDbType.VarChar);
            arrParam[4].Value = Category;
            arrParam[5] = new SqlParameter("@Techni_Type", SqlDbType.VarChar);
            arrParam[5].Value = Techni_Type;
            arrParam[6] = new SqlParameter("@Date", SqlDbType.DateTime);
            arrParam[6].Value = Date;
            arrParam[7] = new SqlParameter("@Validfrom", SqlDbType.DateTime);
            arrParam[7].Value = Validfrom;
            arrParam[8] = new SqlParameter("@validTo", SqlDbType.DateTime);
            arrParam[8].Value = validTo;
            arrParam[9] = new SqlParameter("@Email", SqlDbType.VarChar);
            arrParam[9].Value = Email;
            arrParam[10] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[10].Value = RefName;
            arrParam[11] = new SqlParameter("@ContctNo", SqlDbType.VarChar);
            arrParam[11].Value = ContctNo;
            arrParam[12] = new SqlParameter("@artistCno", SqlDbType.VarChar);
            arrParam[12].Value = artistCno;
            arrParam[13] = new SqlParameter("@IDPic", SqlDbType.VarChar);
            arrParam[13].Value = IDPic;
            arrParam[14] = new SqlParameter("@Id_proof", SqlDbType.VarChar);
            arrParam[14].Value = idProof;
            arrParam[15] = new SqlParameter("@Address_Proof", SqlDbType.VarChar);
            arrParam[15].Value = AddProof;
            arrParam[16] = new SqlParameter("@Amount", SqlDbType.VarChar);
            arrParam[16].Value = Amount;
            arrParam[17] = new SqlParameter("@Group_Artist", SqlDbType.VarChar);
            arrParam[17].Value = group;
            arrParam[14] = new SqlParameter("@DelTo", SqlDbType.VarChar);
            arrParam[14].Value = DelTo;
            arrParam[15] = new SqlParameter("@PostalAddr", SqlDbType.VarChar);
            arrParam[15].Value = PostalAddr;

         int val= Convert.ToInt32(  CTEA_INDIA.DAL.SqlHelper.ExecuteScalar(con, CommandType.StoredProcedure, "CT_InsertArtistCard", arrParam));
         return val;
        }

        public static void Hire_Equip_Appr(int Cid, int p)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@ApprValue", SqlDbType.VarChar);
            arrParam[0].Value = p;
            arrParam[1] = new SqlParameter("@HireId", SqlDbType.VarChar);
            arrParam[1].Value = Cid;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Hire_Equipments_Appr", arrParam);

        }

        public static void Production_Team_Appr(int Cid, int p)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@ApprValue", SqlDbType.VarChar);
            arrParam[0].Value = p;
            arrParam[1] = new SqlParameter("@ProductionTeamId", SqlDbType.VarChar);
            arrParam[1].Value = Cid;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Production_Team_Appr", arrParam);

        }

        public static string[] GetMaxArtistCardId()
        {


            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_Get_Max_ArtistId");

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static void UpdateArtistCardInfo(string Name, string Loc, string Addresss, string ArtsType, string Category, 
            string Techni_Type, string Date, string Validfrom, string validTo, string Email, string RefName,
            string ContctNo, string ID, string Group)
        {
            SqlParameter[] arrParam = new SqlParameter[14];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@Loc", SqlDbType.VarChar);
            arrParam[1].Value = Loc;
            arrParam[2] = new SqlParameter("@Addresss", SqlDbType.VarChar);
            arrParam[2].Value = Addresss;
            arrParam[3] = new SqlParameter("@ArtsType", SqlDbType.VarChar);
            arrParam[3].Value = ArtsType;
            arrParam[4] = new SqlParameter("@Category", SqlDbType.VarChar);
            arrParam[4].Value = Category;
            arrParam[5] = new SqlParameter("@Techni_Type", SqlDbType.VarChar);
            arrParam[5].Value = Techni_Type;
            arrParam[6] = new SqlParameter("@Date", SqlDbType.DateTime);
            arrParam[6].Value = Date;
            arrParam[7] = new SqlParameter("@Validfrom", SqlDbType.DateTime);
            arrParam[7].Value = Validfrom;
            arrParam[8] = new SqlParameter("@validTo", SqlDbType.DateTime);
            arrParam[8].Value = validTo;
            arrParam[9] = new SqlParameter("@Email", SqlDbType.VarChar);
            arrParam[9].Value = Email;
            arrParam[10] = new SqlParameter("@RefName", SqlDbType.VarChar);
            arrParam[10].Value = RefName;
            arrParam[11] = new SqlParameter("@ContctNo", SqlDbType.VarChar);
            arrParam[11].Value = ContctNo;
            arrParam[12] = new SqlParameter("@Artist_Card_Id", SqlDbType.VarChar);
            arrParam[12].Value = ID;
            arrParam[13] = new SqlParameter("@Group_Artist", SqlDbType.VarChar);
            arrParam[13].Value = Group;


            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_Update_Artist_Card", arrParam);


        }

        public static DataSet SearchArtistCard(string columnName, string Value)
        {
            SqlParameter[] arrParam = new SqlParameter[2];
            arrParam[0] = new SqlParameter("@columnName", SqlDbType.VarChar);
            arrParam[0].Value = columnName;
            arrParam[1] = new SqlParameter("@Value", SqlDbType.VarChar);
            arrParam[1].Value = Value;

            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_Search_Artist_Card", arrParam);
            return ds;
        }

        public static string[] getDesignation(int typeID)
        {
            SqlParameter[] arrParam = new SqlParameter[1];
            arrParam[0] = new SqlParameter("@UserType_ID", SqlDbType.VarChar);
            arrParam[0].Value = typeID;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_Get_Designation_From_Id" , arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;
        }

        public static void IDCardApply(string Name, string EmpCode, string Designtn, string pic, string Contno, string EmailId, string UserId, string TechType)
        {
            SqlParameter[] arrParam = new SqlParameter[8];
            arrParam[0] = new SqlParameter("@Name", SqlDbType.VarChar);
            arrParam[0].Value = Name;
            arrParam[1] = new SqlParameter("@EmpCode", SqlDbType.VarChar);
            arrParam[1].Value = EmpCode;
            arrParam[2] = new SqlParameter("@Designtn", SqlDbType.VarChar);
            arrParam[2].Value = Designtn;
            arrParam[3] = new SqlParameter("@pic", SqlDbType.VarChar);
            arrParam[3].Value = pic;
            arrParam[4] = new SqlParameter("@Contno", SqlDbType.VarChar);
            arrParam[4].Value = Contno;
            arrParam[5] = new SqlParameter("@Emailid", SqlDbType.VarChar);
            arrParam[5].Value = EmailId;
            arrParam[6] = new SqlParameter("@UserId", SqlDbType.VarChar);
            arrParam[6].Value = UserId;
            arrParam[7] = new SqlParameter("@TechType", SqlDbType.VarChar);
            arrParam[7].Value = TechType;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_IdCardApply", arrParam);
        }

        public static DataSet getAllSuggestion()
        {
            DataSet ds = CTEA_INDIA.DAL.SqlHelper.ExecuteDataset(con, CommandType.StoredProcedure, "CT_View_Suggestion");
            return ds;
        }

        public static string[] Get_Suggestion_By_Id(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@IDSuggestion", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "CT_GetSuggestionById", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;

        }


        public static string[] Get_Attandance_By_Id(int Cid)
        {
            SqlParameter[] arrParam = new SqlParameter[1];

            arrParam[0] = new SqlParameter("@Id", SqlDbType.Int);
            arrParam[0].Value = Cid;

            SqlDataReader sdr = CTEA_INDIA.DAL.SqlHelper.ExecuteReader(con, CommandType.StoredProcedure, "Get_Attandance_By_Id", arrParam);

            int count = sdr.FieldCount;

            string[] details = new string[count];
            while (sdr.Read())
            {
                for (int i = 0; i < count; i++)
                {
                    details[i] = sdr[i].ToString();

                }

            }
            sdr.Close();
            return details;

        }

        public static void InsertAttendance(string Id)
        {
            SqlParameter[] arrParam = new SqlParameter[8];
            arrParam[0] = new SqlParameter("@Id", SqlDbType.VarChar);
            arrParam[0].Value = Id;
            CTEA_INDIA.DAL.SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "CT_AddAttendance", arrParam);
        }
    }
}
 	

   